package com.wiserun.RestFul.service;

import com.wiserun.RestFul.mapper.BeisenApiTokenMapper;
import com.wiserun.RestFul.model.BeisenToken;
import com.wiserun.develop.contract.model.Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BeisenApiTokenService {
    @Autowired
    private BeisenApiTokenMapper beisenApiTokenMapper;

    /**
     *新增token信息
     * @param beisenToken 北森token信息实体类
     * @return 新增的条数
     */
    public int addToken(BeisenToken beisenToken){
        if(beisenToken != null) {
            return beisenApiTokenMapper.add(beisenToken);
        }
        return 0;
    }

    /**
     * 获取最新的token
     * @return
     */
    public String getNewToken(){
        return beisenApiTokenMapper.getNewToken();
    }
}
